package com.pay.manager.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pay.manager.dao.NotifyMapper;
import com.pay.manager.dao.OrderMapper;
import com.pay.manager.dto.NotifyDTO;
import com.pay.manager.dto.OrderDTO;
import com.pay.manager.pojo.Notify;
import com.pay.manager.pojo.PayOrder;
import com.pay.manager.response.PageDataResult;
import com.pay.manager.service.NotifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Title: NotifyServiceImpl
 * @Description:
 * @author: yjw
 * @version: 1.0
 * @date: 2020/6/12 11:04
 */
@Service
public class NotifyServiceImpl implements NotifyService {
	
	@Autowired
	private NotifyMapper notifyDao;

	@Override
	public PageDataResult getNotifyList(NotifyDTO notifySearch, Integer pageNum, Integer pageSize) {
		 PageDataResult pageDataResult = new PageDataResult();
	        List<Notify> notify = notifyDao.getNotifyList(notifySearch);
	        PageHelper.startPage(pageNum, pageSize);
	        if(notify.size() != 0){
	            PageInfo<Notify> pageInfo = new PageInfo<>(notify);
	            pageDataResult.setList(notify);
	            pageDataResult.setTotals((int) pageInfo.getTotal());
	        }
	        return pageDataResult;
	}
}
